/***********************************************************************************

    Filename:     usb_class_request.h

    Description:  Handle USB class requests for HID class.

***********************************************************************************/

#ifndef USB_CLASS_REQUEST
#define USB_CLASS_REQUEST

// HID Interface indices (as used in USB descriptor) for class request parsing
#define KEYBOARD_INDEX          0
#define MOUSE_INDEX             1

// Constants specifying HID Class requests (bRequest)
#define GET_REPORT              0x01
#define GET_IDLE                0x02
#define GET_PROTOCOL            0x03
#define SET_REPORT              0x09
#define SET_IDLE                0x0A
#define SET_PROTOCOL            0x0B

// Report types for use with the GET_/SET_REPORT request
#define HID_REP_TYPE_INPUT      1
#define HID_REP_TYPE_OUTPUT     2
#define HID_REP_TYPE_FEATURE    3

// Idle rate constants used for GET_/SET_IDLE request
#define HID_IDLE_INDEFINITE     0x0000
#define HID_IDLE_NOT_SET        0x00FF      // Used as dummy init value

// Protocol constants for use with GET_/SET_PROTOCOL request
#define HID_PROTOCOL_BOOT       0
#define HID_PROTOCOL_REPORT     1


// Function prototypes
void usbcrSetReport(void);
void usbcrSetProtocol(void);
void usbcrSetIdle(void);
void usbcrGetReport(void);
void usbcrGetProtocol(void);
void usbcrGetIdle(void);

#endif
